package common

import "gopkg.in/mgo.v2/bson"

type PageQuery struct {
	Query  bson.M `json:"query,omitempty" form:"query"`
	Fields bson.M `json:"fields,omitempty" form:"fields"`

	Sort     []string `json:"sort,omitempty" form:"sort"`
	Page     int      `json:"page" form:"page"`
	PageSize int      `json:"size" form:"size"`

	Waterfall bool `json:"waterfall" form:"waterfall"` //瀑布流（无分页）
}

type Updates struct {
	Query  bson.M `json:"query,omitempty" form:"query"`
	Update bson.M `json:"update,omitempty" form:"update"`
}

type Upsert struct {
	Selector bson.M      `json:"selector,omitempty" form:"selector"`
	Data     interface{} `json:"data,omitempty" form:"data"`
}

type PageResult struct {
	Total int `json:"total"`
	Size  int `json:"size"`
	Page  int `json:"page"`
}
